package phaseII;

import java.util.ArrayList;

public class Rule
{
	private Nonterminal nonterminal;
	private ArrayList<Symbol> rules;
	
	public Rule(Nonterminal n, ArrayList<Symbol> r)
	{
		nonterminal = n;
		rules = r;
	}
	
	public ArrayList<Symbol> getRules()
	{
		return rules;
	}
	
	public Nonterminal getNonterminal()
	{
		return nonterminal;
	}
	@Override
	public boolean equals (Object r)
	{
		if ((((Rule)r).toString()).equals(this.toString()))
			return true;
		else
			return false;
	}
	
	public String toString()
	{
		String x = nonterminal + ":" + rules;
		return x;
	}
	@Override
	public int hashCode()
	{
		return this.toString().hashCode();
	}
	
}
